package com.whatocean.dao;

import com.whatocean.domain.Account;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface AccountDao {

    @Insert("insert into account values (#{id},#{name},#{money})")
    void addAccount(Account account);

    @Delete("delete from account where id = #{id}")
    void delAccount(Integer id);

    @Update("update account set name= #{name} , money = #{money} where id = #{id}")
    void updateAccount(Account account);

    @Select("select * from account where id = #{id}")
    Account findById(Integer id);

    @Select("select * from account")
    List<Account> findAll();

    @Update("update account set money = money + #{money} where name = #{name}")
    void transMoney(@Param("money") String money,@Param("name") Double name);

}
